<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li><a ui-sref="main.sys.menu.list">菜单管理</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
                <!-- 头部 -->
                <div class="panel-heading clearfix">
                    <a  ng-click="approveService()"  class="btn btn-info pull-right">
                        <i class="icon-user-follow m-r-sm text-md"></i>添加按钮</a>
                </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center sort" >
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>按钮名称</th>
                        <th>权限标识</th>
                        <th>菜单名称</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="menuList">
                    <tr ng-repeat="item in pageInfo">
                        <td class="v-middle">{{$index + 1}}</td>
                        <td class="v-middle" style="display: none">{{item.id}}</td>
                        <td class="v-middle" >{{item.btnName}}</td>
                        <td class="v-middle">{{item.permission}}</td>
                        <td class="v-middle">{{item.menuName}}</td>
                        <td class="v-middle">
                            <span ng-if="item.enable==0" class="text-danger">禁用</span>
                            <span ng-if="item.enable==1" class="text-success">启用</span>
                        </td>

                        <td class="v-middle">
                            <a ng-click="approveupdate(item.id,item.btnName,item.permission)" class="btn btn-sm btn-default">
                                <i class="fa fa-edit m-r-xs text-sm"></i>编辑</a>
                            <button type="button" ng-if="item.enable==1"    ng-click="disableItem(item.id,0)" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-ban m-r-xs text-sm"></i>禁用</button>
                            <button type="button" ng-if="item.enable==0"   ng-click="disableItem(item.id,1)" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-ban m-r-xs text-sm"></i>启用</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

        </div><!-- /.panel -->
        <div class="cover" ng-show="firstApply1">
            <form class="form-horizontal"  name="btnform" id="btnform">
            <div class="firstApplyWrap">
                <div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply1=false">&#xe608;</i></div>
                <div class="title" >
                    <div class="modal-header">
                        <!--<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>-->
                        <h4 class="modal-title" id="CashLabel">按钮设置</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                            <input type="hidden" ng-model="menuId"  >
                            <input type="hidden" ng-model="btnId"  >
                            <div class="form-group">
                                <label class="col-lg-2 col-sm-3 control-label" >
                                    <span class="text-danger wrapper-sm">*</span>按钮名称</label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control"   placeholder="请输入按钮名称..." ng-model="btnName">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-2 col-sm-3 control-label">
                                    <span class="text-danger wrapper-sm">*</span>权限标识</label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control"  ng-value="permission" placeholder="请输入权限标识..." ng-model="permission">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" ng-click="firstApply1=false" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary" ng-disabled="isDisabled">确定</button>
                    </div>
                </div>

            </div>
            </form>
        </div>
    </div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->

<style>
    .cover {
        position: fixed;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 2000;
        top: 0;
        left: 0;
        /* display: none; */
    }

    .firstApplyWrap{
        width: 800px;
        height:600px;
        background: #fff;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
        -ms-transform: translate(-50%,-50%);
        -o-transform: translate(-50%,-50%);
        -moz-transform: translate(-50%,-50%);
        border-radius: 5px;
        overflow: hidden;
    }
    .firstApplyWrap .title{
        font-size: 18px;
        color:#333;
        padding:18px 36px 0 36px;
        text-align: center;
        line-height: 2em;
    }
    .firstApplyWrap .closeBtn,.finishData .closeBtn{
        font-size: 30px;
        padding:5px 10px 0 0;
        border-radius: 50%;
        color: #ccc;
        float: right;
        cursor: pointer;
    }
    .finishData .closeBtn{
        position: absolute;
        top:10px;
        right:10px;
    }
    .firstApplyWrap .bkgIcon{
        position: absolute;
        left: 54px;
        top:87px;
        font-size: 50px;
        color:#FFB136;
    }
    .firstApplyWrap .applyBtnWrap{
        position: absolute;
        bottom: -2px;
        width: 100%;
    }
    .firstApplyWrap .applyBtn{
        width: 50%;
        height:70px;
        line-height: 70px;
        background: #FFB135;
        font-size: 20px;
        text-align: center;
        color:#fff;
        cursor: pointer;
        float:left;
    }
    .firstApplyWrap .applyBtn:last-child{
        background: #5796FC;
    }
</style>